package com.Lixiaoqian.Gulangyu.adapter

import android.content.Context
import android.view.View
import android.widget.ImageView
import android.widget.ProgressBar
import com.Lixiaoqian.Gulangyu.R
import com.Lixiaoqian.Gulangyu.route_m.bean.RouteBean
import com.Lixiaoqian.Gulangyu.utils.GlideUtil


/**
 * Created by huangzhibo on 2018-02-28.
 * mail:1043202454@qq.com
 */
class BannerAdapter(var context: Context) : BannerBaseAdapter<RouteBean>(context) {
    override fun getLayoutResID(): Int {
        return R.layout.item_pager_banner
    }

    override fun convert(convertView: View?, data: RouteBean) {
        val imageView = getView<ImageView>(R.id.wd_banner_img)
        val progressBar = getView<ProgressBar>(R.id.wd_banner_progress)
        GlideUtil.getInstance().loadImage(context,imageView,data.imgRes,true)
        setText(R.id.wd_tv_banner_titile,data.title)
        setText(R.id.wd_tv_progress_mun,"进度: ${data.currentNum}/${data.totalNum}")
        progressBar.max=data.totalNum
        progressBar.progress=data.currentNum
    }


}